import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: 花海
 * Date: 2022-09-14
 * Time: 12:06
 */
public class landlord {
     private String Username;
     private String password;

    public String getUsername() {
        return Username;
    }

    public void setUsername(String username) {
        Username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public landlord(String username, String password) {
        Username = username;
        this.password = password;
    }

    public static void main(String[] args) {
        landlord user=new landlord("jini","taimei");
        Scanner sc=new Scanner(System.in);
       try {
           System.out.println("请输入账号");
           String Username = sc.next();
           if (Username.equals(user.getUsername())) {
               System.out.println("请输入密码");
               String password = sc.next();
               if(password.equals(user.getPassword())){
                   System.out.println("登陆成功");
               }else{
                   throw new UsernameExpection("密码错误");

               }
           } else {
               throw new UsernameExpection("用户名错误");
           }
       }catch(UsernameExpection eu){
           eu.printStackTrace();

       }catch(PasswordExpection ep){
           ep.printStackTrace();

        }






    }
}
